package com.howard.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 *
 * @author Howard.He
 * @since 2011-06-10
 *
 */
@Controller
@RequestMapping("/topic")
public class TopicController {


	@RequestMapping(value = "/{name}", method = RequestMethod.GET)
	public String doHey(@PathVariable String name, HttpServletRequest request, HttpServletResponse response) {
		request.setAttribute("message", "You Input Topic Name is: <b>" + name + "</b>");
		return "topic";
	}

	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
	public String dohelloWorld(@PathVariable Long id,
			HttpServletRequest request, HttpServletResponse response) {
		request.setAttribute("message", "You Input Topic Id is: <b>" + id + "</b>");
		return "topic";
	}
}
